סעיף ב )11 נקודות( public synchronized void advance(staircase staircase) throws InterruptedException staircase!

Size: px
Start display at page:

Download "סעיף ב )11 נקודות( public synchronized void advance(staircase staircase) throws InterruptedException staircase!"

Transcription

1 גיליון תשובות מספר נבחן: 03( שאלה 1 סעיף א 0<=size()<=capacity()=to()-from()+1 המחלקה בטוחה כי הגישה לשדות שאינם final מסונכרנת, והתוכנה הנשמרת לעייל תמיד מתקיימת אי בדיקת ערכי toheight ו fromheight בבנאי, והאינדקס i ב,setPedestrian() אינה פוגמת באינווריאנטה, כי יזרק Exception )ביצירת המערך,_pedestrians ובגישה אליו(. אם כוללים באינווריאנטה את האילוץ, שהולך רגל אינו מופיע בשתי מדרגות בו זמנית ( j V 0<=i,j<capacity(), i =! getpedestrian(j) ( getpedestrian(i) =! התכונה לא מתקיימת בהכרח בקוד הנתון. תנאי התחלה: 5 נקודות בטיחות: 5 נקודות סעיף ב )11 public synchronized void advance(staircase staircase) throws InterruptedException { staircase!= null && (staircase.getpedestrian(getheight() - staircase.fromheight()) == this getheight() staircase.fromheight() getheight() staircase.toheight()) && staircase.getpedestrian(getstrategy().next(getheight()) - staircase. fromheight()) == null //@POST: getheight() == getstrategy().next(@pre(getheight()) && staircase.getpedestrian(@pre(getheight() - staircase.fromheight()) == null && staircase.getpedestrian(getheight() - staircase.fromheight()) == this synchronized(staircase) { while (!(staircase!= null && staircase.getpedestrian(_strategy.next(getheight()) - staircase. fromheight()) == null && (_height == staircase.fromheight() _height == staircase.toheight() staircase.getpedestrian(_height - staircase. fromheight()) == this))) staircase.wait(); staircase.setpedestrian(null, _height - staircase.fromheight()); _height = _strategy.next(_height); staircase.setpedestrian(this, _height - staircase.fromheight()); staircase.notifyall(); staircase wait הערה: בפיתרון זה קיימת סכנת חבק, בשל תפישת המנעול על this אותו(. עם היציאה ל על )המשחררת רק 1

2 מפתח ניקוד: תנאי התחלה: 3 נקודות תנאי סיום: 1 נקודות מימוש: 7 נקודות בבדיקת המימוש הושם דגש על הנקודות הבאות - מנגנון המתנה המבוסס על wait/notify - שימוש במוניטור מתאים )staircase( - רצף סנכרון בין בדיקת תנאי התחלה ועד ביצוע הפעולה - חישוב נכון של האינדקס בגרם המדרגות ביחס לגובה הולך הרגל - עדכון גובה הולך הרגל - עדכון המדרגות סעיף ג )8 חבק של המתנה הדדית עשוי להתרחש, בין שני הולכי רגל האחד עולה והשני יורד, הנפגשים בשתי מדרגות סמוכות. חבק זה המכונה בשפה המקצועית חמור ג ר ם משתחרר בנוכחות הת'רד המבצע את המשימה,StairCaseMovementTask המביאה את הולכי הרגל החבוקים למפלס פתוח. 03( שאלה 2 class StairCase { public: virtual ~StairCase(); virtual int fromheight() const = 0; virtual int toheight() const = 0; virtual Pedestrian *getpedestrian(int i) const = 0; virtual void setpedestrian(pedestrian *pedestrian,int i) = 0; virtual int size() const = 0; virtual int capacity() const = 0; סעיף א )18 class StairCaseImpl : public StairCase { private: Pedestrian **_pedestrians; int _fromheight; int _toheight; public: StairCaseImpl(int fromheight, int toheight) { 1

3 _fromheight = fromheight; _toheight = toheight; _size=0; _pedestrians = new Pedestrian*[_toHeight - _fromheight + 1] ; virtual ~StairCaseImpl(){ delete[] _pedestrians; StairCaseImpl(const StairCase& other){ _fromheight = other.fromheight(); _toheight = other. toheight(); _pedestrians = new Pedestrian*[other.capacity()] ; for(int i=0; i other.capacity(); i++){ _pedestrians[i] = other. getpedestrian(i); StairCaseImpl & operator=(const StairCase& other) { _fromheight = other. fromheight(); _toheight = other. toheight(); delete[] pedestrians; _pedestrians = new Pedestrian*[other.capacity()] ; for(int i=0; i other.capacity(); i++){ _pedestrians[i] = other. getpedestrian(i); int fromheight () const { return _fromheight; int toheight () const { return _toheight; int capacity() const { return _toheight - _fromheight + 1; int size() const { int size=0; for(int i=0; i<_toheight - _fromheight + 1; i++){ if (_pedestrians[i]!=null) size++; return size; Pedestrian* getpedestrian(int i) const { return _pedestrians[i]; void setpedestrian(pedestrian *p, int i) { 3

4 _pedestrians[i] = p; ; סעיף ב )11 Stack address value meaning pointer to upstaircase return address from Q _toheight _fromheight pointer to _pedestrians in heap 1020 *vtable pointer to downstaircase in heap _toheight _fromheight pointer to _pedestrians in heap 1000 *vtable Heap address value meaning 7000 _pedestrians[39] _pedestrians array 6012 _pedestrians[39] _pedestrians array _toheight _fromheight 6000 *vtable 5000 _pedestrians[39] _pedestrians array 4

5 Grading Key 1. Missing inheritance, missing implementation of StairCase, StairCaseImpl, missing virtual methods C++ Syntax, Constructor (ctor), Destructor (dtor) [ ] 3. Definition, allocation and free of pedestrian array: Copy Constructor (copy ctor), Operator= Memory diagram a. each missing entry -3 b. missing vtable pointers -4 (no multiple deduction if missing inheritance above) c. functions, return address (r.a), parameters on stack -3, stack, heap confusions - 3 שאלה )03 0 סעיף א )10 What are the changes required to make StairCase are remote interface are the following (as documented in ): 1. On the StairCase interface: - Mark the interface remote by extending java.rmi.remote - Add java.rmi.remoteexception to all methods in the interface 2. On the StairCaseImpl implementation (the remote object): - Inherit from the java.rmi.server.unicastremoteobject - Add java.rmi.remoteexception to all methods of the class 3. In the process that publishes the remote object (the class Simulation), make the remote object available, by registering it in the rmiregistry: - Naming.rebind(" :4004/StairCase1", upstaircase); - In the specific case, it makes sense to add a method to the interface to indicate it is now under control of the remote controller that ensures the staircase movement but this was not expected as part of this answer. 4. Make sure all the parameters passed to and returned by remote methods are either: - Primitive types (int, char ) - Serializable types - Remote objects In our case, the parameters passed in the StairCase interface are: int and Pedestrian. So we had to make sure that class Pedestrian is Serializable. [Making this list was sufficient to get credit issue 4 was not taken into account in the grading, any missing indication of 1, 2 or 3 above caused a 3 point deduction] Most common errors: - Not listing the RemoteExceptions 5

6 - Marking that a class or an interface throws exception (I was shocked how many students wrote something that strange). A class does not throw an exception only methods do. - Confuse extends and implements (the remote interface extends java.rmi.remote, the remote object extends java.rmi.server.unicastremoteobject). - Forget about the Serializable condition on parameters (was not counted in the grading) In code: interface StairCase extends java.rmi.remote { int fromheight() throws java.rmi.remoteexception; int toheight() throws java.rmi.remoteexception; Pedestrian getpedestrian(int i) throws java.rmi.remoteexception; void setpedestrian(pedestrian pedestrian,int i) throws java.rmi.remoteexception; int size() throws java.rmi.remoteexception; int capacity() throws java.rmi.remoteexception; class StairCaseImpl implements StairCase extends java.rmi.server.unicastremoteobject { private final Pedestrian[] _pedestrians; private final int _fromheight; private final int _toheight; StairCaseImpl(int fromheight, int toheight) throws java.rmi.remoteexception { _fromheight = fromheight; _toheight = toheight; _pedestrians = new Pedestrian[_toHeight - _fromheight + 1] ; public int fromheight ()throws java.rmi.remoteexception { return _fromheight; public int toheight ()throws java.rmi.remoteexception { return _toheight; public int capacity()throws java.rmi.remoteexception { return _pedestrians.length; public synchronized int size() throws java.rmi.remoteexception { int size=0; for (Pedestrian p : _pedestrians) if (p!=null) size++; return size; public synchronized Pedestrian getpedestrian(int i) throws java.rmi.remoteexception { return _pedestrians[i]; public synchronized void setpedestrian(pedestrian p, int i) throws java.rmi.remoteexception { _pedestrians[i] = p; 6

7 class Simulation { public static void main(string[] args) { StairCase upstaircase = new StairCaseImpl(1, 39); Naming.rebind(" :4004/StairCase1", upstaircase); Pedestrian pedestrian1 = new Passenger(1,new HurryUp()); Pedestrian pedestrian2 = new Passenger(39,new HurryDown()); new Thread(new StairCaseMovementTask (upstaircase,1000)).start(); // Would make sense to wait until the remote staircase movement task is started not necessary new Thread(new PedestrianMovementTask (pedestrian1,1000, upstaircase)).start(); new Thread(new PedestrianMovementTask (pedestrian2,1000, upstaircase)).start(); interface Pedestrian extends java.io.serializable { int getheight(); void setheight(int height); Strategy getstrategy(); void advance(staircase staircase); סעיף ב )7 How many communication operations are necessary to move up a staircase by 3 steps? We look at what the RMI client does: StairCase upstaircase=(staircase)naming.lookup(" :4004/staircase1 new Thread(new StairCaseMovementTask (upstaircase,1000)).start(); The Naming.lookup() call causes one round-trip communication with the rmiregistry server. The other part is of the process is that the remote object upstaircase is accessed through the run() method of StairCaseMovementTask. So we look at the code of run(): public void run() { while (true) { try { for (int i=_staircase.capacity()-1; i>0; i--) { _staircase.setpedestrian(_staircase.getpedestrian(i-1),i); Pedestrian p = _staircase.getpedestrian(i); if (p!=null) p.setheight(p.getheight()+1); 7

8 _staircase.setpedestrian(null,0); synchromized(_staircase) { _staircase.notifyall(); Thread.sleep(_speed); catch (InterruptedException e) { In this code, _staircase is bound to a remote object (that is, it is a stub that sends remote calls to the remote object). This means each call on _staircase is a remote call and we want to call such remote calls each call is a round-trip communication operation. The calls are: For each iteration in the while(true) loop: In the for loop (capacity() times): getpedestrian() setpedestrian() setpedestrian(null) [We can either ignore the notifyall() call as indicated in the question or count it as a remote variant] Total: (capacity() * 2 + 1) calls per iteration. Each iteration moves the stair by 1 step up. We want to count 3 steps up: 3 * (capacity() * 2 + 1) + 1 (lookup) We know that capacity() is 39 in our case giving: 3 * (39 * 2 + 1) + 1 = 238 round trip operations. Possible variation: - Some students assumed that the Pedestrian interface is a remote interface instead of being a serializable interface. This is fine and in this case, p.setheight() and p.getheight() must be counted as 2 round-trip calls in the loop. Most common errors: - Not counting the operations at all (detail which operations are remote calls). - Giving a random number as an answer. - Not taking into account the loop over the capacity(). - Not taking into account the loop for 3 steps - Not counting the lookup() operation [Either loops omission was counted as 2 point deduction] סעיף ג )3 Must the class StairCaseImpl.class be present in the file system side of the process running StairCaseControl? 8

9 No it does not since this is a remote object, which is accessed through the remote interface StairCase. When StairCaseControl executes: StairCase upstaircase=(staircase)naming.lookup(" :4004/staircase1 It gets in return an instance of the stub class (StairCaseStub.class) which implements the StairCase interface. It never accesses the staircaseimpl code, which is only operated on the side of the Simulation process. סעיף ד )10 Assume the implementation of the skel uses the Reactor pattern. A student proposes to remove the synchronized directive on the run() method of ProtocolTask, and instead to limit it half of the method (dealing with the tokenizer and protocol and not with the part dealing with the buffers and tokenizer). - Does the change affect correctness? - What is the condition that the synchronized run() enforces? First why is run() synchronized? Notes from the reactor pattern: - A protocoltask instance is associated to a single connectionhandler. That means, a protocoltask will only operate on the same client connection. There is only one protocoltask per connectionhandler. - The protocoltask is submitted to the thread pool executor each time new data is read by the connectionhandler (in the read() method). When run() is synchronized, we know that the calls to run() from the executor will be serialized (executed sequentially one after the other) so that 2 threads from the thread pool cannot execute the same task simultaneously. If we remove the synchronized directive from run(), then there can be the following situation: - ConnectionHandler receives a read event from the reactor and posts its task to the thread pool for execution. - Thread T1 from the thread pool starts running the task. - Another read event arrives from the reactor to the ConnectionHandler and the same task is posted again to the thread pool for execution. - Thread T2 from the thread pool starts running the same task while T1 is still working on the same task. Can this fact cause correctness problems? - If the 2 read events come from 2 separate messages m1 and m2 sent from the same client, then this could potentially lead to a situation where the server processes m2 before m1 and it does not respect the order of messages sent by the client. - If the 2 read events come from 2 fragments of the same message m1, or from fragments that overlap 2 distinct messages m1 and m2, then potentially, this situation could lead to a situation where the bytes are added to the tokenizer in the wrong order. 9

10 Note that the other way to access the protocol task is through the method addbytes() which is invoked by the ConnectionHandler (in the reactor thread), when it receives data in the read() event. But note that addbytes() is NOT synchronized and this is on purpose. The buffers queue serves as a buffer between the reactor thread (producer) and the thread running the protocoltask (consumer). Between these 2 active objects, only the buffers object needs to be synchronized, and it is properly synchronized in all places where buffers is accessed. Now we need to look at the details because the proposed code does not completely remove the synchronization it moves it from one place to another (smaller scope). So can we really get the risks highlighted above? With the synchronization proposed by the student, we have 2 sections the sync(buffers) part, and the sync(this) part. So we can now get the situation with 2 threads active on the same ProtocolTask instance: - T1 is inside part1 (moves buffers from buffers to tokenizer) - T2 is inside part2 (moves messages from tokenizer to protocol, execute protocol and pass return data to connectionhandler). But we cannot have a situation where T1 and T2 are together in part1 or together in part2. Risk 1: (protocol processes m2 before m1) cannot happen because the messages are inserted in order from buffers to tokenizer: only the reactor thread adds to buffers so buffers is always ordered, and whether T1 or T2 read from buffers, they always push to the same tokenizer so tokenizer gets data in the proper order. Since only one thread can read complete messages from tokenizer at a time, and the sequence read message / execute message is synchronized, there is no risk of message order inversion. Risk 2: (buffers with partial messages are pushed into tokenizer in the wrong order) cannot happen because buffers are pushed into tokenizer by one thread at a time and the sequence buffers.remove() / tokenizer.add() is synchronized. Note that the only element that is shared between part1 and part2 is the tokenizer and we must make sure that tokenizer is properly fully synchronized. In the reactor code, this is indeed the case. All in all the changes proposed by the student are safe. Note: we do not discuss here whether the changes are beneficial or not to the reactor. They could increase parallelism but they could also reduce scalability it depends on the pattern of communication between clients and server (many fragmented messages, several messages sent in sequence by the client without getting a response from the server). This is out of the scope of the question. Grading considered: - Any mention of message ordering got a credit of 5 points or more. - Any mention of partial messages ordering got a credit of 3 points or more. - Any mention that tokenizer must be fully synchronized got a credit of 5 points or more. - Explanation that lack of synchronization brings risk is not sufficient we expected specific explanation of the risks. 10

11 - Explanation that there is only one client for this server were wrong. The risks exist even with a single client. 03( שאלה 4 סעיף א )5 Data Model: create table Location ( LocationId int primary key, LocationName varchar(200), City varchar(200), Country varchar(100)) create table Staircase ( StaircaseId int Primary Key, LocationId int Foreign Key references Location, Orientation int // 1 = ascending, 2 = descending ) create table StaircaseOperation ( StaircaseId int Foreign Key references Staircase, OperationDay datetime, PassengersNumber int, AverageTripDuration int, // average duration in milliseconds Primary Key (StaircaseId, OperationDay) ) Common Errors: - Types of fields must be specified (int, varchar, date, Boolean) [1 point] - Primary Keys must be specified for each table [2 to 3 points] - Primary Keys must be unique for each table [OperationDay alone in StaircaseOperation is not unique, it cannot be PK] - Foreign Keys must be specified [2 to 3 points] - When there is a relation 1-n from T1 to T2, then the foreign key is in table T2. In our example, the relation Staircase to StaircaseOperations is 1-n (there is one row of Operations for each date for each staircase). Therefore, the foreign key (StaircaseId) is in the table StaircaseOperations (and not the opposite a date field in the Staircase table). - Tables must be normalized [Was not penalized] - If there is a group of fields that are repeated in many rows, normalization consists of replacing these fields with a foreign key to a table where the group of fields are stored. For example, since LocationName, City and Country could possibly be repeated many times for each staircase in each location in the same city, we defined the table Location to normalize the schema. 11

12 סעיף ב )5 Select Staircase.StaircaseId, Location.LocationName, StaircaseOperation.PassengersNumber From ((Staircase inner join Location on Staircase.locationId = Location.LocationId) inner join staircaseoperation on staircase.staircaseid = staircaseoperation.staircaseid) Where Location.city = 'Beer Sheva' and StaircaseOperation.OperationDay = ' ' Order by StaircaseOperation.PassengersNumber asc 11

- במפלס התחתון (בתחתית המדרגות) ובמפלס העליון (בראש המדרגות) יש מקום לכל הולכי הרגל

- במפלס התחתון (בתחתית המדרגות) ובמפלס העליון (בראש המדרגות) יש מקום לכל הולכי הרגל אוניברסיטת בן-גוריון מדור בחינות מספר נבחן: רשמו תשובותיכם בגיליון התשובות בלבד תשובות מחוץ לגיליון לא יבדקו. בהצלחה! תאריך הבחינה: 24.1.2011 שם המורה: פרופ' מיכאל אלחדד ד"ר מני אדלר ד"ר אנדרי שרף שם הקורס:

More information

גיליון תשובות מספר נבחן:

גיליון תשובות מספר נבחן: גיליון תשובות מספר נבחן: 03( שאלה 1 סעיף א )02 (i) //@PRE: checkinv(other.getx(),other.gety(),other.getradius()) //@POST: getradius() other.getradius() >= // Math.max(Math.abs(getY()-other.getY()),Math.abs(getX()-

More information

גיליון תשובות מספר נבחן: סעיף ג (10 נקודות) הגדרת בטיחות הינה שמירה על האינווריאנטה של האובייקטים במהלך ההרצה.

גיליון תשובות מספר נבחן: סעיף ג (10 נקודות) הגדרת בטיחות הינה שמירה על האינווריאנטה של האובייקטים במהלך ההרצה. גיליון תשובות מספר נבחן: (30 נקודות) שאלה 1 סעיף א (15 נקודות) remove() המתודה remove() גם משנה את מצב האובייקט,(command) וגם מחזירה ערך.(query) על פי עקרונות העיצוב שלמדנו בכיתה יש להפריד שאילתות מפקודות.

More information

Contents. Java RMI. Java RMI. Java RMI system elements. Example application processes/machines Client machine Process/Application A

Contents. Java RMI. Java RMI. Java RMI system elements. Example application processes/machines Client machine Process/Application A Contents Java RMI G53ACC Chris Greenhalgh Java RMI overview A Java RMI example Overview Walk-through Implementation notes Argument passing File requirements RPC issues and RMI Other problems with RMI 1

More information

Distributed Objects SPL/ SPL 201 / 0 1

Distributed Objects SPL/ SPL 201 / 0 1 Distributed Objects 1 distributed objects objects which reside on different machines/ network architectures, benefits, drawbacks implementation of a remote object system 2 Why go distributed? large systems

More information

גיליון תשובות מספר נבחן:

גיליון תשובות מספר נבחן: גיליון תשובות מספר נבחן: 30( שאלה 1 נקודות( א. ב. התכונה הנשמרת מתייחסת אך ורק למיקום המכוניות בצומת, כלומר למיקום המכוניות בשדה _cars הגישה לשדה זה מסונכרנת, אך מצד שני אין בדיקה של מיקום המכונית טרם

More information

Object Interaction. Object Interaction. Introduction. Object Interaction vs. RPCs (2)

Object Interaction. Object Interaction. Introduction. Object Interaction vs. RPCs (2) Introduction Objective To support interoperability and portability of distributed OO applications by provision of enabling technology Object interaction vs RPC Java Remote Method Invocation (RMI) RMI Registry

More information

Info 408 Distributed Applications Programming Exercise sheet nb. 4

Info 408 Distributed Applications Programming Exercise sheet nb. 4 Lebanese University Info 408 Faculty of Science 2017-2018 Section I 1 Custom Connections Info 408 Distributed Applications Programming Exercise sheet nb. 4 When accessing a server represented by an RMI

More information

JAVA RMI. Remote Method Invocation

JAVA RMI. Remote Method Invocation 1 JAVA RMI Remote Method Invocation 2 Overview Java RMI is a mechanism that allows one to invoke a method on an object that exists in another address space. The other address space could be: On the same

More information

55:182/22C:182. Distributed Application Frameworks Java RMI, CORBA, Web Services (SOAP)

55:182/22C:182. Distributed Application Frameworks Java RMI, CORBA, Web Services (SOAP) 55:182/22C:182 Distributed Application Frameworks Java RMI, CORBA, Web Services (SOAP) Broker Architecture Example Java Remote Method Invocation (RMI) Invoking a method which lies in a different address

More information

Remote Method Invocation

Remote Method Invocation Remote Method Invocation A true distributed computing application interface for Java, written to provide easy access to objects existing on remote virtual machines Provide access to objects existing on

More information

IBD Intergiciels et Bases de Données

IBD Intergiciels et Bases de Données IBD Intergiciels et Bases de Données RMI-based distributed systems Fabien Gaud, Fabien.Gaud@inrialpes.fr Overview of lectures and practical work Lectures Introduction to distributed systems and middleware

More information

Generic architecture

Generic architecture Java-RMI Lab Outline Let first builds a simple home-made framework This is useful to understand the main issues We see later how java-rmi works and how it solves the same issues Generic architecture object

More information

Remote Procedure Call

Remote Procedure Call Remote Procedure Call Suited for Client-Server structure. Combines aspects of monitors and synchronous message passing: Module (remote object) exports operations, invoked with call. call blocks (delays

More information

Threads Chate Patanothai

Threads Chate Patanothai Threads Chate Patanothai Objectives Knowing thread: 3W1H Create separate threads Control the execution of a thread Communicate between threads Protect shared data C. Patanothai Threads 2 What are threads?

More information

1 interface TemperatureSensor extends java.rmi.remote 2 { 3 public double gettemperature() throws java.rmi.remoteexception; 4 public void

1 interface TemperatureSensor extends java.rmi.remote 2 { 3 public double gettemperature() throws java.rmi.remoteexception; 4 public void 1 interface TemperatureSensor extends java.rmi.remote 2 { 3 public double gettemperature() throws java.rmi.remoteexception; 4 public void addtemperaturelistener ( TemperatureListener listener ) 5 throws

More information

Common Misunderstandings from Exam 1 Material

Common Misunderstandings from Exam 1 Material Common Misunderstandings from Exam 1 Material Kyle Dewey Stack and Heap Allocation with Pointers char c = c ; char* p1 = malloc(sizeof(char)); char** p2 = &p1; Where is c allocated? Where is p1 itself

More information

מצליחה. 1. int fork-bomb() 2. { 3. fork(); 4. fork() && fork() fork(); 5. fork(); printf("bla\n"); 8. return 0; 9. }

מצליחה. 1. int fork-bomb() 2. { 3. fork(); 4. fork() && fork() fork(); 5. fork(); printf(bla\n); 8. return 0; 9. } שאלה : (4 נקודות) א. ב. ג. (5 נקודות) הגדירו את המונח race-condition במדוייק לא להשמיט פרטים. ספקו דוגמא. (5 נקודות) מהו? Monitor נא לספק הגדרה מלאה. ( נקודות) ( נקודות) ציינו כמה תהליכים יווצרו בקוד הבא

More information

RMI. Remote Method Invocation. 16-Dec-16

RMI. Remote Method Invocation. 16-Dec-16 RMI Remote Method Invocation 16-Dec-16 The network is the computer Consider the following program organization: method SomeClass call AnotherClass returned object computer 1 computer 2 If the network is

More information

DISTRIBUTED COMPUTING

DISTRIBUTED COMPUTING DISTRIBUTED COMPUTING SYSTEMS 1 REMOTE PROCEDURE CALL RPC-REMOTE PROCEDURE CALL RMI-REMOTE METHOD INVOCATION 2 3 RPC TECHNOLOGY Remote procedure call is a technology that allows computer programs to call

More information

Chair of Software Engineering. Java and C# in depth. Carlo A. Furia, Marco Piccioni, Bertrand Meyer. Java: concurrency

Chair of Software Engineering. Java and C# in depth. Carlo A. Furia, Marco Piccioni, Bertrand Meyer. Java: concurrency Chair of Software Engineering Carlo A. Furia, Marco Piccioni, Bertrand Meyer Java: concurrency Outline Java threads thread implementation sleep, interrupt, and join threads that return values Thread synchronization

More information

CS555: Distributed Systems [Fall 2017] Dept. Of Computer Science, Colorado State University

CS555: Distributed Systems [Fall 2017] Dept. Of Computer Science, Colorado State University CS 555: DISTRIBUTED SYSTEMS [RMI] Frequently asked questions from the previous class survey Shrideep Pallickara Computer Science Colorado State University L21.1 L21.2 Topics covered in this lecture RMI

More information

גיליון תשובות מספר נבחן:

גיליון תשובות מספר נבחן: גיליון תשובות מספר נבחן: 30) שאלה 1 ראשית, מספר הערות על מאפייני משחק הקלפים (מטאפורה ש חוּ קה על החיים, הקורס, והמבחן) אשר פורטו בשאלה זו: משחק מרתק המשלב הנאה. ראו מקרה הרב יהודה-אריה מודנה, מגדולי המלומדים

More information

Objects Managing a Resource

Objects Managing a Resource Objects Managing a Resource 1 What is a Resource Respects Release/Acquire protocol files (open/close) memory allocation (allocate/free) locks (acquire/release). 2 What is a Resource Objects when constructed,

More information

Written by: Dave Matuszek

Written by: Dave Matuszek RMI Remote Method Invocation Written by: Dave Matuszek appeared originally at: http://www.cis.upenn.edu/~matuszek/cit597-2003/ 28-May-07 The network is the computer * Consider the following program organization:

More information

AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS

AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS PAUL L. BAILEY Abstract. This documents amalgamates various descriptions found on the internet, mostly from Oracle or Wikipedia. Very little of this

More information

The UNIVERSITY of EDINBURGH. SCHOOL of INFORMATICS. CS4/MSc. Distributed Systems. Björn Franke. Room 2414

The UNIVERSITY of EDINBURGH. SCHOOL of INFORMATICS. CS4/MSc. Distributed Systems. Björn Franke. Room 2414 The UNIVERSITY of EDINBURGH SCHOOL of INFORMATICS CS4/MSc Distributed Systems Björn Franke bfranke@inf.ed.ac.uk Room 2414 (Lecture 3: Remote Invocation and Distributed Objects, 28th September 2006) 1 Programming

More information

מבוא למדעי המחשב תרגול 8 רשימה משורשרת כללית, Comparator

מבוא למדעי המחשב תרגול 8 רשימה משורשרת כללית, Comparator מבוא למדעי המחשב 2017 תרגול 8 רשימה משורשרת כללית, Comparator בתרגול היום. LinkedList בניית ההכללה מ- LinkIntList תרגול המבנה ושימושיו ממשקים: Comparator Sorted Linked List ל- LinkedList ע"י שימוש ב- Comparator

More information

VALLIAMMAI ENGINEERING COLLEGE

VALLIAMMAI ENGINEERING COLLEGE VALLIAMMAI ENGINEERING COLLEGE SRM Nagar, Kattankulathur 603 203 DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING QUESTION BANK B.E. - Electrical and Electronics Engineering IV SEMESTER CS6456 - OBJECT ORIENTED

More information

Concurrent Programming using Threads

Concurrent Programming using Threads Concurrent Programming using Threads Threads are a control mechanism that enable you to write concurrent programs. You can think of a thread in an object-oriented language as a special kind of system object

More information

Distributed Systems. Distributed Object Systems 2 Java RMI. Java RMI. Example. Applet continued. Applet. slides2.pdf Sep 9,

Distributed Systems. Distributed Object Systems 2 Java RMI. Java RMI. Example. Applet continued. Applet. slides2.pdf Sep 9, Distributed Object Systems 2 Java RMI Piet van Oostrum Distributed Systems What should a distributed system provide? Illusion of one system while running on multiple systems Transparancy Issues Communication,

More information

Distributed Systems. 02r. Java RMI Programming Tutorial. Paul Krzyzanowski TA: Long Zhao Rutgers University Fall 2017

Distributed Systems. 02r. Java RMI Programming Tutorial. Paul Krzyzanowski TA: Long Zhao Rutgers University Fall 2017 Distributed Systems 02r. Java RMI Programming Tutorial Paul Krzyzanowski TA: Long Zhao Rutgers University Fall 2017 1 Java RMI RMI = Remote Method Invocation Allows a method to be invoked that resides

More information

JAC444 - Lecture 11. Remote Method Invocation Segment 2 - Develop RMI Application. Jordan Anastasiade Java Programming Language Course

JAC444 - Lecture 11. Remote Method Invocation Segment 2 - Develop RMI Application. Jordan Anastasiade Java Programming Language Course JAC444 - Lecture 11 Remote Method Invocation Segment 2 - Develop RMI Application 1 Remote Method Invocation In this lesson you will be learning about: Designing RMI application Developing distributed object

More information

About this exam review

About this exam review Final Exam Review About this exam review I ve prepared an outline of the material covered in class May not be totally complete! Exam may ask about things that were covered in class but not in this review

More information

CGS 2405 Advanced Programming with C++ Course Justification

CGS 2405 Advanced Programming with C++ Course Justification Course Justification This course is the second C++ computer programming course in the Computer Science Associate in Arts degree program. This course is required for an Associate in Arts Computer Science

More information

CC755: Distributed and Parallel Systems

CC755: Distributed and Parallel Systems CC755: Distributed and Parallel Systems Dr. Manal Helal, Spring 2016 moodle.manalhelal.com Lecture 7: Remote Method Invocation (RMI) 1 RMI Y Daniel Liang, Introduction to JAVA Programming, 9th Edition,

More information

גיליון תשובות מספר נבחן:

גיליון תשובות מספר נבחן: גיליון תשובות מספר נבחן: 03( שאלה 1 סעיף א )11 - כפי שנלמד בהרצאות, התכונה נשמרת ותנאי התחלה וסיום מוגדרים על הממשק, ולא על מימוש ספציפי. ההגדרה צריכה להתבסס על שאילתות בסיס. במידה והשאילתות בממשק אינן

More information

תוכנה 1 סמסטר א' תשע"א

תוכנה 1 סמסטר א' תשעא General Tips on Programming תוכנה 1 סמסטר א' תשע"א תרגול מס' 6 מנשקים, דיאגרמות וביטים * רובי בוים ומתי שמרת Write your code modularly top-down approach Compile + test functionality on the fly Start with

More information

Network. Dr. Jens Bennedsen, Aarhus University, School of Engineering Aarhus, Denmark

Network. Dr. Jens Bennedsen, Aarhus University, School of Engineering Aarhus, Denmark Network Dr. Jens Bennedsen, Aarhus University, School of Engineering Aarhus, Denmark jbb@ase.au.dk Outline Socket programming If we have the time: Remote method invocation (RMI) 2 Socket Programming Sockets

More information

Verteilte Systeme (Distributed Systems)

Verteilte Systeme (Distributed Systems) Verteilte Systeme (Distributed Systems) Karl M. Göschka Karl.Goeschka@tuwien.ac.at http://www.infosys.tuwien.ac.at/teaching/courses/ VerteilteSysteme/ Lecture 3: Communication (Part 2) Remote Procedure

More information

G Programming Languages Spring 2010 Lecture 13. Robert Grimm, New York University

G Programming Languages Spring 2010 Lecture 13. Robert Grimm, New York University G22.2110-001 Programming Languages Spring 2010 Lecture 13 Robert Grimm, New York University 1 Review Last week Exceptions 2 Outline Concurrency Discussion of Final Sources for today s lecture: PLP, 12

More information

CS 450 Exam 2 Mon. 11/7/2016

CS 450 Exam 2 Mon. 11/7/2016 CS 450 Exam 2 Mon. 11/7/2016 Name: Rules and Hints You may use one handwritten 8.5 11 cheat sheet (front and back). This is the only additional resource you may consult during this exam. No calculators.

More information

Name: I. 20 II. 20 III. 20 IV. 40. CMSC 341 Section 01 Fall 2016 Data Structures Exam 1. Instructions: 1. This is a closed-book, closed-notes exam.

Name: I. 20 II. 20 III. 20 IV. 40. CMSC 341 Section 01 Fall 2016 Data Structures Exam 1. Instructions: 1. This is a closed-book, closed-notes exam. CMSC 341 Section 01 Fall 2016 Data Structures Exam 1 Name: Score Max I. 20 II. 20 III. 20 IV. 40 Instructions: 1. This is a closed-book, closed-notes exam. 2. You have 75 minutes for the exam. 3. Calculators,

More information

Distributed Computing

Distributed Computing Distributed Computing Computing on many systems to solve one problem Why? - Combination of cheap processors often more cost-effective than one expensive fast system - Flexibility to add according to needs

More information

Introduction to Programming Using Java (98-388)

Introduction to Programming Using Java (98-388) Introduction to Programming Using Java (98-388) Understand Java fundamentals Describe the use of main in a Java application Signature of main, why it is static; how to consume an instance of your own class;

More information

Orbacus Version JThreads/C++ Guide

Orbacus Version JThreads/C++ Guide Orbacus Version 4.3.5 JThreads/C++ Guide Micro Focus The Lawn 22-30 Old Bath Road Newbury, Berkshire RG14 1QN UK http://www.microfocus.com Copyright Micro Focus 2016. All rights reserved. MICRO FOCUS,

More information

CPS 310 midterm exam #1, 2/17/2017

CPS 310 midterm exam #1, 2/17/2017 CPS 310 midterm exam #1, 2/17/2017 Your name please: NetID: Sign for your honor: Answer all questions. Please attempt to confine your answers to the boxes provided. If you don t know the answer to a question,

More information

Ch. 11: References & the Copy-Constructor. - continued -

Ch. 11: References & the Copy-Constructor. - continued - Ch. 11: References & the Copy-Constructor - continued - const references When a reference is made const, it means that the object it refers cannot be changed through that reference - it may be changed

More information

Modern Programming Languages. Lecture Java Programming Language. An Introduction

Modern Programming Languages. Lecture Java Programming Language. An Introduction Modern Programming Languages Lecture 27-30 Java Programming Language An Introduction 107 Java was developed at Sun in the early 1990s and is based on C++. It looks very similar to C++ but it is significantly

More information

Questions and Answers. A. RMI allows us to invoke a method of java object that executes on another machine.

Questions and Answers. A. RMI allows us to invoke a method of java object that executes on another machine. Q.1) What is Remote method invocation (RMI)? A. RMI allows us to invoke a method of java object that executes on another machine. B. RMI allows us to invoke a method of java object that executes on another

More information

Distributed Systems COMP 212. Lecture 10 Othon Michail

Distributed Systems COMP 212. Lecture 10 Othon Michail Distributed Systems COMP 212 Lecture 10 Othon Michail RMI: Remote Method Invocation Allows an object running in one Java virtual machine to invoke methods on an object running in another Java virtual machine.

More information

Announcements. Lecture 04b Header Classes. Review (again) Comments on PA1 & PA2. Warning about Arrays. Arrays 9/15/17

Announcements. Lecture 04b Header Classes. Review (again) Comments on PA1 & PA2. Warning about Arrays. Arrays 9/15/17 Announcements Lecture 04b Sept. 14 th, 2017 Midterm #1: Sept. 26 th (week from Tuesday) Code distributed one week from today PA2 test cases & answers posted Quiz #4 next Tuesday (before class) PA3 due

More information

JThreads/C++ Version 2.0.0b1. IONA Technologies PLC

JThreads/C++ Version 2.0.0b1. IONA Technologies PLC JThreads/C++ Version 2.0.0b1 IONA Technologies PLC IONA, IONA Technologies, the IONA logo, Orbix, High Performance Integration, Artix, Mobile Orchestrator and Making Software Work Together are trademarks

More information

Orbacus. JThreads/C++ Making Software Work Together TM. Version 2.0, January 2007

Orbacus. JThreads/C++ Making Software Work Together TM. Version 2.0, January 2007 TM Orbacus JThreads/C++ Version 2.0, January 2007 Making Software Work Together TM IONA Technologies PLC and/or its subsidiaries may have patents, patent applications, trademarks, copyrights, or other

More information

CSci Introduction to Distributed Systems. Communication: RPC In Practice

CSci Introduction to Distributed Systems. Communication: RPC In Practice CSci 5105 Introduction to Distributed Systems Communication: RPC In Practice Linux RPC Language-neutral RPC Can use Fortran, C, C++ IDL compiler rpgen N to generate all stubs, skeletons (server stub) Example:

More information

Multiple Inheritance. Computer object can be viewed as

Multiple Inheritance. Computer object can be viewed as Multiple Inheritance We have seen that a class may be derived from a given parent class. It is sometimes useful to allow a class to be derived from more than one parent, inheriting members of all parents.

More information

Reflection/RMI 4/28/2009

Reflection/RMI 4/28/2009 Reflection/RMI 4/28/2009 1 Opening Discussion Solutions to the interclass problem. Do you have any questions about the assignment? Minute Essays Why are heap operations always O(log n)? Java programs connecting

More information

CS 6456 OBJCET ORIENTED PROGRAMMING IV SEMESTER/EEE

CS 6456 OBJCET ORIENTED PROGRAMMING IV SEMESTER/EEE CS 6456 OBJCET ORIENTED PROGRAMMING IV SEMESTER/EEE PART A UNIT I 1. Differentiate object oriented programming from procedure oriented programming. 2. Define abstraction and encapsulation. 3. Differentiate

More information

INSTRUCTIONS TO CANDIDATES

INSTRUCTIONS TO CANDIDATES NATIONAL UNIVERSITY OF SINGAPORE SCHOOL OF COMPUTING MIDTERM ASSESSMENT FOR Semester 2 AY2017/2018 CS2030 Programming Methodology II March 2018 Time Allowed 90 Minutes INSTRUCTIONS TO CANDIDATES 1. This

More information

Background. vanilladb.org

Background. vanilladb.org Background vanilladb.org Why do you need a database system? 2 To store data, why not just use a file system? 3 Advantages of a Database System It answers queries fast Q1: among a set of blog pages, find

More information

Array. Prepared By - Rifat Shahriyar

Array. Prepared By - Rifat Shahriyar Java More Details Array 2 Arrays A group of variables containing values that all have the same type Arrays are fixed length entities In Java, arrays are objects, so they are considered reference types

More information

Exam duration: 3 hours Number of pages: 10

Exam duration: 3 hours Number of pages: 10 INFOMGEP 2011 Retake exam Student name: Student number: Exam duration: 3 hours Number of pages: 10 All the answers have to be written in the corresponding boxes. It is allowed to have: - lecture notes

More information

Threads and Parallelism in Java

Threads and Parallelism in Java Threads and Parallelism in Java Java is one of the few main stream programming languages to explicitly provide for user-programmed parallelism in the form of threads. A Java programmer may organize a program

More information

System Programming. Practical Session 4: Threads and Concurrency / Safety

System Programming. Practical Session 4: Threads and Concurrency / Safety System Programming Practical Session 4: Threads and Concurrency / Safety Using Threads - All the computer programs you've seen so far were sequential only one thing was performed at any given time - Sometimes

More information

Only one thread can own a specific monitor

Only one thread can own a specific monitor Java 5 Notes Threads inherit their priority and daemon properties from their creating threads The method thread.join() blocks and waits until the thread completes running A thread can have a name for identification

More information

Short Notes of CS201

Short Notes of CS201 #includes: Short Notes of CS201 The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with < and > if the file is a system

More information

Introduction to Java

Introduction to Java Introduction to Java Module 1: Getting started, Java Basics 22/01/2010 Prepared by Chris Panayiotou for EPL 233 1 Lab Objectives o Objective: Learn how to write, compile and execute HelloWorld.java Learn

More information

An Introduction to C++

An Introduction to C++ An Introduction to C++ Introduction to C++ C++ classes C++ class details To create a complex type in C In the.h file Define structs to store data Declare function prototypes The.h file serves as the interface

More information

שאלה 1, סעיף ב )11 נק'(

שאלה 1, סעיף ב )11 נק'( שאלה 1, סעיף א )8 נק'( public static boolean lexlt(string s1, String s2) for (int i=0; i

More information

Administrivia. CMSC433, Fall 2001 Programming Language Technology and Paradigms. Administrivia (cont.) Project 1. Copy constructor.

Administrivia. CMSC433, Fall 2001 Programming Language Technology and Paradigms. Administrivia (cont.) Project 1. Copy constructor. CMSC433, Fall 2001 Programming Language Technology and Paradigms Alan Sussman September 4, 2001 Administrivia Quiz answers posted on Exams web page C++ readings from textbook posted on Readings web page

More information

MARKING KEY The University of British Columbia MARKING KEY Computer Science 260 Midterm #1 Examination 12:30 noon, Tuesday, February 14, 2012

MARKING KEY The University of British Columbia MARKING KEY Computer Science 260 Midterm #1 Examination 12:30 noon, Tuesday, February 14, 2012 MARKING KEY The University of British Columbia MARKING KEY Computer Science 260 Midterm #1 Examination 12:30 noon, Tuesday, February 14, 2012 Instructor: K. S. Booth Time: 70 minutes (one hour ten minutes)

More information

CS201 - Introduction to Programming Glossary By

CS201 - Introduction to Programming Glossary By CS201 - Introduction to Programming Glossary By #include : The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with

More information

RMI Case Study. A Typical RMI Application

RMI Case Study. A Typical RMI Application RMI Case Study This example taken directly from the Java RMI tutorial http://java.sun.com/docs/books/tutorial/rmi/ Editorial note: Please do yourself a favor and work through the tutorial yourself If you

More information

Synchronization

Synchronization Synchronization 10-28-2013 Synchronization Coming next: Multithreading in JavaFX (javafx.concurrent) Read: Java Tutorial on concurrency JavaFX Tutorial on concurrency Effective Java, Chapter 9 Project#1:

More information

AIMS Embedded Systems Programming MT 2017

AIMS Embedded Systems Programming MT 2017 AIMS Embedded Systems Programming MT 2017 Object-Oriented Programming with C++ Daniel Kroening University of Oxford, Computer Science Department Version 1.0, 2014 Outline Classes and Objects Constructors

More information

FORM 2 (Please put your name and form # on the scantron!!!!) CS 161 Exam II:

FORM 2 (Please put your name and form # on the scantron!!!!) CS 161 Exam II: FORM 2 (Please put your name and form # on the scantron!!!!) CS 161 Exam II: True (A)/False(B) (2 pts each): 1. The declaration below declares three pointer variables of type pointer to double that is

More information

Programming Assignment 2

Programming Assignment 2 CS 122 Fall, 2004 Programming Assignment 2 New Mexico Tech Department of Computer Science Programming Assignment 2 CS122 Algorithms and Data Structures Due 11:00AM, Wednesday, October 13th, 2004 Objectives:

More information

Multitasking Multitasking allows several activities to occur concurrently on the computer. A distinction is usually made between: Process-based multit

Multitasking Multitasking allows several activities to occur concurrently on the computer. A distinction is usually made between: Process-based multit Threads Multitasking Multitasking allows several activities to occur concurrently on the computer. A distinction is usually made between: Process-based multitasking Thread-based multitasking Multitasking

More information

03 Remote invocation. Request-reply RPC. Coulouris 5 Birrel_Nelson_84.pdf RMI

03 Remote invocation. Request-reply RPC. Coulouris 5 Birrel_Nelson_84.pdf RMI 03 Remote invocation Request-reply RPC Coulouris 5 Birrel_Nelson_84.pdf RMI 2/16 Remote Procedure Call Implementation client process Request server process client program client stub procedure Communication

More information

Exercise Session Week 8

Exercise Session Week 8 Chair of Software Engineering Java and C# in Depth Carlo A. Furia, Marco Piccioni, Bertrand Meyer Exercise Session Week 8 Java 8 release date Was early September 2013 Currently moved to March 2014 http://openjdk.java.net/projects/jdk8/milestones

More information

Chapter 4: Processes. Process Concept. Process State

Chapter 4: Processes. Process Concept. Process State Chapter 4: Processes Process Concept Process Scheduling Operations on Processes Cooperating Processes Interprocess Communication Communication in Client-Server Systems 4.1 Process Concept An operating

More information

Get Unique study materials from

Get Unique study materials from Downloaded from www.rejinpaul.com VALLIAMMAI ENGNIEERING COLLEGE SRM Nagar, Kattankulathur 603203. DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Year & Semester : IV Section : EEE - 1 & 2 Subject Code

More information

CMSC 132: Object-Oriented Programming II. Threads in Java

CMSC 132: Object-Oriented Programming II. Threads in Java CMSC 132: Object-Oriented Programming II Threads in Java 1 Problem Multiple tasks for computer Draw & display images on screen Check keyboard & mouse input Send & receive data on network Read & write files

More information

Multithread Computing

Multithread Computing Multithread Computing About This Lecture Purpose To learn multithread programming in Java What You Will Learn ¾ Benefits of multithreading ¾ Class Thread and interface Runnable ¾ Thread methods and thread

More information

Questions: ECE551 PRACTICE Final

Questions: ECE551 PRACTICE Final ECE551 PRACTICE Final This is a full length practice midterm exam. If you want to take it at exam pace, give yourself 175 minutes to take the entire test. Just like the real exam, each question has a point

More information

Lecture 35. Threads. Reading for next time: Big Java What is a Thread?

Lecture 35. Threads. Reading for next time: Big Java What is a Thread? Lecture 35 Threads Reading for next time: Big Java 21.4 What is a Thread? Imagine a Java program that is reading large files over the Internet from several different servers (or getting data from several

More information

1 Shyam sir JAVA Notes

1 Shyam sir JAVA Notes 1 Shyam sir JAVA Notes 1. What is the most important feature of Java? Java is a platform independent language. 2. What do you mean by platform independence? Platform independence means that we can write

More information

Instance Method Development Demo

Instance Method Development Demo Instance Method Development Demo Write a class Person with a constructor that accepts a name and an age as its argument. These values should be stored in the private attributes name and age. Then, write

More information

הערה על הפתרון: בתנאי הקדם אין לבדוק שהמשחק לא השתנה. המתודה מוגדרת היטב ויש לה ערך החזרה למקרה זה.

הערה על הפתרון: בתנאי הקדם אין לבדוק שהמשחק לא השתנה. המתודה מוגדרת היטב ויש לה ערך החזרה למקרה זה. אוניברסיטת בן-גוריון מדור בחינות מספר נבחן: רשמו תשובותיכם בגיליון התשובות בלבד, תשובות מחוץ לגיליון לא יבדקו. שימו לב: על תשובות ריקות יינתן 20% מהניקוד. בהצלחה! תאריך הבחינה : 6.3.2017 שם המורה : ד"ר

More information

Problem Solving with C++

Problem Solving with C++ GLOBAL EDITION Problem Solving with C++ NINTH EDITION Walter Savitch Kendrick Mock Ninth Edition PROBLEM SOLVING with C++ Problem Solving with C++, Global Edition Cover Title Copyright Contents Chapter

More information

1 Constructors and Inheritance (4 minutes, 2 points)

1 Constructors and Inheritance (4 minutes, 2 points) CS180 Spring 2010 Final Exam 8 May, 2010 Prof. Chris Clifton Turn Off Your Cell Phone. Use of any electronic device during the test is prohibited. Time will be tight. If you spend more than the recommended

More information

CSE351 Winter 2016, Final Examination March 16, 2016

CSE351 Winter 2016, Final Examination March 16, 2016 CSE351 Winter 2016, Final Examination March 16, 2016 Please do not turn the page until 2:30. Rules: The exam is closed-book, closed-note, etc. Please stop promptly at 4:20. There are 125 (not 100) points,

More information

Java Threads. Written by John Bell for CS 342, Spring 2018

Java Threads. Written by John Bell for CS 342, Spring 2018 Java Threads Written by John Bell for CS 342, Spring 2018 Based on chapter 9 of Learning Java, Fourth Edition by Niemeyer and Leuck, and other sources. Processes A process is an instance of a running program.

More information

Exercise Session Week 8

Exercise Session Week 8 Chair of Software Engineering Java and C# in Depth Carlo A. Furia, Marco Piccioni, Bertrand Meyer Exercise Session Week 8 Quiz 1: What is printed? (Java) class MyTask implements Runnable { public void

More information

Developing RMI Based Server (ChatServer)

Developing RMI Based Server (ChatServer) Introduction Developing RMI Based Server (ChatServer) In the last module, we have learnt about RMI. In this module we will look at how to create an interactive application like chat server using RMI. Demo

More information

Java RMI Activation: A running example We have the following classes: MyRemoteInterface: the remote interface. Client: the client that invokes a

Java RMI Activation: A running example We have the following classes: MyRemoteInterface: the remote interface. Client: the client that invokes a Java RMI Activation: A running example We have the following classes: MyRemoteInterface: the remote interface. Client: the client that invokes a method on the remote object. ActivableImplementation: the

More information

גיליון תשובות על תשובות ריקות יינתן 20% מהניקוד!

גיליון תשובות על תשובות ריקות יינתן 20% מהניקוד! גיליון תשובות על תשובות ריקות יינתן 20% מהניקוד! מספר נבחן: 30( שאלה 1 סעיף א )7 שני ת'רדים המפעילים את מתודת ה move על אחד משני גלגלים סמוכים מסוג SimpleGear הת'רד הראשון תופס את הגלגל הראשון this( שלו(,

More information

Desarrollo de Aplicaciones en Red RMI. Introduction. Considerations. Considerations. RMI architecture

Desarrollo de Aplicaciones en Red RMI. Introduction. Considerations. Considerations. RMI architecture session Desarrollo de Aplicaciones en Red José Rafael Rojano Cáceres http://www.uv.mx/rrojano RMI Remote Method Invocation Introduction Java RMI let s work calling remote methods. Underneath it works with

More information

Written by John Bell for CS 342, Spring 2018

Written by John Bell for CS 342, Spring 2018 Advanced OO Concepts Written by John Bell for CS 342, Spring 2018 Based on chapter 3 of The Object-Oriented Thought Process by Matt Weisfeld, with additional material from other sources. Constructors Constructors

More information

Last Class: Network Overview. Today: Distributed Systems

Last Class: Network Overview. Today: Distributed Systems Last Class: Network Overview =>Processes in a distributed system all communicate via a message exchange. Physical reality: packets Abstraction: messages limited size arbitrary size unordered (sometimes)

More information